/********************************************************************************
  * @file     SD93F115B_dbgmcu.h
  * @author   TEST TEAM												    	
  * @version  v0															    	
  * @date     Septemper 2022												    	
  * @brief
  *
  * Copyright (C) 2022  Hangzhou SDIC Microelectronics Co., Ltd
**********************************************************************************/


/* Define to prevent recursive inclusion */
#ifndef __SD93F115B_DBGMCU_H
#define __SD93F115B_DBGMCU_H

#ifdef __cplusplus
 extern "C" {
#endif

/****************Includes******************/
#include "SD93F115B.h"


/***********************EXTI Trigger enumeration***************/

#define  DBGMCU_MEM_MODE_RAM               ((uint8_t)0x00)
#define  DBGMCU_MEM_MODE_BOOT              ((uint8_t)0x01)
#define  DBGMCU_MEM_MODE_FLASH             ((uint8_t)0x02)

#define IS_DBGMCU_StartupMode(Mode) (((Mode) == DBGMCU_MEM_MODE_RAM)||\
                                     ((Mode) == DBGMCU_MEM_MODE_BOOT)||\
								     ((Mode) == DBGMCU_MEM_MODE_FLASH))

/******************DBGMCU_Exported_Constants******************/
#define DBGMCU_WWDG_STOP                   DBGMCU_CR_WWDG_STOP
#define DBGMCU_IWDG_STOP                   DBGMCU_CR_IWDG_STOP
#define DBGMCU_I2CTIMEOUT_STOP    		   DBGMCU_CR_I2C_TMEOUT

#define IS_DBGMCU_PERIPH(PERIPH) (((PERIPH) == DBGMCU_WWDG_STOP)||\
                                  ((PERIPH) == DBGMCU_IWDG_STOP)||\
								  ((PERIPH) == DBGMCU_I2CTIMEOUT_STOP))

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */ 

/* Device and Revision ID management functions ********************************/ 
uint32_t DBGMCU_GetIDR(void);											                    //读取IDR

void DBGMCU_StartupModeConfig(uint8_t DBGMCU_MEM_MODE,FunctionalState NewState);			//配置芯片的启动方式
void DBGMCU_PeriphModeConfig(uint32_t DBGMCU_Periph, FunctionalState NewState);	            //调试状态下，WWDG,IWDG,I2C等外设在DBG模式下是否停止工作
void DBGMCU_BOOT_IWDG_STOPCmd(FunctionalState NewState);                                    //从bootloader启动时硬件独立看门狗停止工作（默认停止）

void DBGMCU_MCUHardResetCmd(FunctionalState NewState);                                      //硬件复位MCU

void DBGMCU_LowPower_DBGMCUCmd(FunctionalState NewState);                                   //调试状态下，MCU进入LowPower模式后，是否仍可进行DBG调试

#ifdef __cplusplus
}
#endif

#endif /* __SD93F115B_DBGMCU_H */


/*****************************END OF FILE****************************/
